package Comprehensive_02;

public class Test2 {
    public static void main(String[] args) {
        // 斐波那契数列
        // 求斐波那契数列第十二个的值
        int[] arr = new int[12];
        arr[0] = 1;
        arr[1] = 1;
        for (int i = 2; i < arr.length; i++) {
            arr[i] = arr[i - 1] + arr[i - 2];
        }
        System.out.println(arr[11]);
        System.out.println(feiBo(12));
    }

    public static int feiBo(int num){
        if (num == 1 || num == 2){
            return 1;
        }
        return feiBo(num - 1) + feiBo(num - 2);
    }
}
